1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a program, and more particularly, to an image processing apparatus, an image processing method, and a program capable of preventing an image from being broken down due to a difference between an image at a first pass and an image at a second pass in a configuration of two passes.
2. Description of the Related Art
When pixels in an image are processed in image signal processing, information regarding a wide range near the processed pixels is used. For example, in the calculation of a bilateral filter used in HDR (high dynamic range) compression processing, information regarding a range of several hundreds of pixels which are within the radius of the processed pixels is used.
In the image signal processing of using this wide range information, calculation cost for each pixel tends to increase. That is, since the size of hardware or calculation time of software increases, it is difficult to perform the image signal processing at one step.
In order to realize signal processing of using a wide range of information, the processing is divided into a plurality of steps to reduce the calculation cost in many cases. For example, in order to reduce the calculation cost, the calculation of the bilateral filter is divided into two steps: a step of generating intermediate data by calculating a pair of representative values from the wide range of information and a step of performing processing for each pixel using the representative values.
The above-described two-step configuration is disclosed in Japanese Unexamined Patent Application Publication No. 2001-275015 (corresponding to U.S. Pat. No. 6,965,416) and Japanese Unexamined Patent Application Publication No. 2004-221645 (corresponding to U.S. Pat. No. 7,570,390). The bilateral filter is disclosed in Japanese Unexamined Patent Application Publication No. 2009-177558 (corresponding to European Patent Application Publication No. 2131569).
In general, in a bilateral filter BLF(pc) for an image, as indicated in Expression (1) below, pixel values I(p) of pixels around an important pixel position pc are added in a weighting function ω(p−pc) in a space direction and a weighting function φ(I(p)−I(pc)) in a luminance value direction.
                    [                  Expression          ⁢                                          ⁢          1                ]                                                                      BLF          ⁡                      (            pc            )                          =                                            ∑                              p                ∈                Ω                                      ⁢                                          ω                ⁡                                  (                                      p                    -                    pc                                    )                                            ·                              ϕ                ⁡                                  (                                                            I                      ⁡                                              (                        p                        )                                                              -                                          I                      ⁡                                              (                        pc                        )                                                                              )                                            ·                              I                ⁡                                  (                  p                  )                                                                                        ∑                              p                ∈                Ω                                      ⁢                                          ω                ⁡                                  (                                      p                    -                    pc                                    )                                            ·                              ϕ                ⁡                                  (                                                            I                      ⁡                                              (                        p                        )                                                              -                                          I                      ⁡                                              (                        pc                        )                                                                              )                                                                                        (        1        )            
The denominator on the right-hand side in Expression (1) indicates a normalization coefficient of a weighted value.